#include<iostream>
#include<string>
using namespace std;
class Student
{
	private:
		string name;
		double math;
		double chinese;
		double english;
		int counter;
	public:
		Student(string name,double math,double chinese,double english)
		:name(name),math(math),chinese(chinese),english(english)
		{	
		counter=1;
		}
		void show()
		{
			cout<<"name math chinese english in average:\n"
			<<math/counter<<" "<<chinese/counter<<" "<<english/counter<<endl;
		}
		friend Student operator + (Student a,Student b);
		//leave "operator = (Student a)" as default
};
Student operator + (Student a,Student b)
		{
			Student res("res",0,0,0);
			res.math=b.math+a.math;
			res.english=b.english+a.english;
			res.chinese=b.chinese+a.chinese;
			res.counter=b.counter+a.counter;
			return res;
		}
int main()
{
	Student a("jack",15,15,15),b("rose",18,79,56),c("someone",48,68,45);
	Student res("res",0,0,0);
	res=a+b+c;
	res.show();
	return 0;
}
